const express = require("express");
const router = express.Router();
const upload = require("../uploadConfig/upload.js");
router.post("/upload", (req, res) => {
  upload(req, res)
    .then((url) => {
      res.send({
        code: 0,
        message: "上传成功",
        result: {
          url: url,
        },
      });
    })
    .catch((err) => {
      res.response("上传失败");
    });
});

module.exports = router;
